package org.jks.util;

import java.net.URL;

public class OSUtil {
	public static final String CLASS_PATH;
	public static final boolean isLinux;
	static {
		URL resource = OSUtil.class.getResource("OSUtil.class");
		String classPath = resource.getPath();
		String className = OSUtil.class.getName().replace('.', '/') + ".class";
		String classesPath = classPath.substring(0, classPath.indexOf(className));

		if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") != -1
				&& classesPath.startsWith("/")) {
			classesPath = classesPath.substring(1);
			isLinux = false;
		} else {
			isLinux = true;
		}
		CLASS_PATH = classesPath;
	}

	public static boolean isWindows() {
		return !isLinux;
	}

	public static boolean isLinux() {
		return isLinux;
	}

	public static void main(String args[]) {
		
		System.out.println(OSUtil.isWindows());

	}
}
